// 车险单证数据重构
import {template, transitionKey} from '@/components/ivew_components/car_india/dataTemplate'
import { deepCopy } from "@/utils/tools"

export default (ctx, next) =>{
    let resData = ctx.params;
    let cache = deepCopy(template);

    // 将请求数据填充到 模板数据中
    resData['singleInfo'].forEach(item =>{
        let key = transitionKey(item.type);
        if(key){
            cache[key] = item;
        }
    })

    ctx.params['singleInfo'] = cache;

    next()
}